package com.example.demo2.mapper;
import com.example.demo2.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
@Mapper
public interface UserMapper {

    @Select("select * from users where uID=#{uID}")
    User findUserById(@Param("uID") Integer uID);

    @Select("select uPw from users where uID=#{uID}")
    String findPwdById(@Param("uID") Integer uID);

    @Update("update users set uName=#{user.uName},uCompany=#{user.uCompany},uNUM=#{user.uNum},uEmail=#{user.uEmail} where uID=#{user.uID}")
    int updateUser(@Param("user")  User user);

    @Update("update users set uPw=#{uPw} where uID=#{uID}")
    int updateUserPw(@Param("uID") Integer uID, @Param("uPw") String uPw);

}
